< previous page page_577 next page >

Page 577
Technique
Description
Bookmark property
Identifies the location of a specific record.
AbsolutePosition
Moves the record pointer to a specific record position in the recordset.
PercentPosition
Moves the record pointer to the record property nearest the indicated percentage position in the recordset.

Each of these techniques has benefits and limitations, as described in the following sections.
Using the Move Methods
You can use the five different Move methods on any recordsets available in Visual Basic:
Move Method
Action
MoveFirst
Moves the record pointer from the current record to the first record in the opened recordset.
MoveNext
Moves the record pointer from the current record to the next record (the record following the current record) in the opened recordset. If no next record exists (that is, if you are already at the last record), the end-of-file (EOF) flag is set, and there will be no current record.
MovePrevious
Moves the record pointer from the current record to the preceding record in the opened recordset. If no previous record exists (that is, if you are at the first record), the beginning-of-file (BOF) flag is set, and there will be no current record.
MoveLast
Moves the record pointer from the current record to the last record in the opened recordset.
Move n
Moves the record pointer from the current record n records down (if n is positive) or up (if n is negative) in the opened recordset. If the move would place the record pointer beyond the end of the recordset (either BOF or EOF), an error occurs.

These commands move the record pointer to the record indicated based on the current order of the recordset. The current order of the recordset is the physical order, unless an index was set for a table, or a dynaset or snapshot was created with a particular order specified.
To enhance the sample project to show the use of the MoveFirst, MovePrevious, MoveNext, and MoveLast methods, follow these steps:
sarrow.gifSee "Setting the Current Index in a Table," p.581
1. Add four command buttons named cmdFirst, cmdPrevious, cmdNext, and cmdLast.
2. Set their Caption properties as follows:
d6ef40187df115e88326dbc94f09ab9a.gif
First record
d6ef40187df115e88326dbc94f09ab9a.gif
Next record
d6ef40187df115e88326dbc94f09ab9a.gif
Previous record
d6ef40187df115e88326dbc94f09ab9a.gif
Last record

 
< previous page page_577 next page >